// 引入request
import request from '../utils/request.js'
/*
    用户登录接口
 * data:{username,password}
*/
const getUserLogin = (data) => {
    return request({url: '/admin/login',method: 'POST',data})
}
/**
 * 获取用户信息
 */
const getUserInfo =()=>{
    // token
    return request({url: '/admin/getUserInfo',method: 'GET'})
}
/***
 * 校验原密码接口
 * data:{userId,password}
 */
const checkOldPass = (data) => {
    return request({url: '/user/pwd',method: 'POST', data})
}
/**
 * 修改密码接口
 * data:{userId,password}
 * 
 */
const changeUserPass = (data) => {
    return request({url: "/user/pwd", method: 'PUT', data})
}
/**
 * 用户退出接口
 */
const userLogut = () => {
    //token
    return request({url: "/admin/logout",method: 'POST'})
}
//导出user相关的接口
export default {
    getUserLogin,
    getUserInfo,
    changeUserPass,
    checkOldPass,
    userLogut
}